Skip g_convert when to_codeset and from_codeset are both 'UTF-8' (gnome
authorHidetoshi Tajima <tajima@src.gnome.org>
Mon, 6 Aug 2001 17:09:26 +0000 (17:09 +0000)
committerHidetoshi Tajima <tajima@src.gnome.org>
Mon, 6 Aug 2001 17:09:26 +0000 (17:09 +0000)
* modules/input/gtkimcontextxim.c (mb_to_utf8), xim_text_to_utf8):
Skip g_convert when to_codeset and from_codeset are both 'UTF-8'
(gnome bugzilla #58202)

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
modules/input/gtkimcontextxim.c

index d84578a1a2120190e760a2e7539ca7e643c45589..63a5cf578d852ff3983e21f68f629a72bc026b00 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-08-06  HideToshi Tajima  <tajima@eng.sun.com>
+
+       * modules/input/gtkimcontextxim.c (mb_to_utf8), xim_text_to_utf8):
+       Skip g_convert when to_codeset and from_codeset are both 'UTF-8'
+       (gnome bugzilla #58202)
+
 2001-08-06  Havoc Pennington  <hp@pobox.com>
  
        * gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): The whole 
index d84578a1a2120190e760a2e7539ca7e643c45589..63a5cf578d852ff3983e21f68f629a72bc026b00 100644 (file)
@@ -1,3 +1,9 @@
+2001-08-06  HideToshi Tajima  <tajima@eng.sun.com>
+
+       * modules/input/gtkimcontextxim.c (mb_to_utf8), xim_text_to_utf8):
+       Skip g_convert when to_codeset and from_codeset are both 'UTF-8'
+       (gnome bugzilla #58202)
+
 2001-08-06  Havoc Pennington  <hp@pobox.com>
  
        * gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): The whole 
index d84578a1a2120190e760a2e7539ca7e643c45589..63a5cf578d852ff3983e21f68f629a72bc026b00 100644 (file)
@@ -1,3 +1,9 @@
+2001-08-06  HideToshi Tajima  <tajima@eng.sun.com>
+
+       * modules/input/gtkimcontextxim.c (mb_to_utf8), xim_text_to_utf8):
+       Skip g_convert when to_codeset and from_codeset are both 'UTF-8'
+       (gnome bugzilla #58202)
+
 2001-08-06  Havoc Pennington  <hp@pobox.com>
  
        * gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): The whole 
index d84578a1a2120190e760a2e7539ca7e643c45589..63a5cf578d852ff3983e21f68f629a72bc026b00 100644 (file)
@@ -1,3 +1,9 @@
+2001-08-06  HideToshi Tajima  <tajima@eng.sun.com>
+
+       * modules/input/gtkimcontextxim.c (mb_to_utf8), xim_text_to_utf8):
+       Skip g_convert when to_codeset and from_codeset are both 'UTF-8'
+       (gnome bugzilla #58202)
+
 2001-08-06  Havoc Pennington  <hp@pobox.com>
  
        * gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): The whole 
index d84578a1a2120190e760a2e7539ca7e643c45589..63a5cf578d852ff3983e21f68f629a72bc026b00 100644 (file)
@@ -1,3 +1,9 @@
+2001-08-06  HideToshi Tajima  <tajima@eng.sun.com>
+
+       * modules/input/gtkimcontextxim.c (mb_to_utf8), xim_text_to_utf8):
+       Skip g_convert when to_codeset and from_codeset are both 'UTF-8'
+       (gnome bugzilla #58202)
+
 2001-08-06  Havoc Pennington  <hp@pobox.com>
  
        * gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): The whole 
index d84578a1a2120190e760a2e7539ca7e643c45589..63a5cf578d852ff3983e21f68f629a72bc026b00 100644 (file)
@@ -1,3 +1,9 @@
+2001-08-06  HideToshi Tajima  <tajima@eng.sun.com>
+
+       * modules/input/gtkimcontextxim.c (mb_to_utf8), xim_text_to_utf8):
+       Skip g_convert when to_codeset and from_codeset are both 'UTF-8'
+       (gnome bugzilla #58202)
+
 2001-08-06  Havoc Pennington  <hp@pobox.com>
  
        * gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): The whole 
index d84578a1a2120190e760a2e7539ca7e643c45589..63a5cf578d852ff3983e21f68f629a72bc026b00 100644 (file)
@@ -1,3 +1,9 @@
+2001-08-06  HideToshi Tajima  <tajima@eng.sun.com>
+
+       * modules/input/gtkimcontextxim.c (mb_to_utf8), xim_text_to_utf8):
+       Skip g_convert when to_codeset and from_codeset are both 'UTF-8'
+       (gnome bugzilla #58202)
+
 2001-08-06  Havoc Pennington  <hp@pobox.com>
  
        * gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): The whole 
index 2da314c81eb8d6cc81395394fedf04bb19357463..141d15f858aa55e933cf7e1ab851d3a01655354a 100644 (file)
@@ -281,14 +281,18 @@ mb_to_utf8 (GtkIMContextXIM *context_xim,
   GError *error = NULL;
   gchar *result;
 
-  result = g_convert (str, -1,
-                     "UTF-8", context_xim->mb_charset,
-                     NULL, NULL, &error);
-
-  if (!result)
+  if (strcmp (context_xim->mb_charset, "UTF-8") == 0)
+    result = g_strdup (str);
+  else
     {
-      g_warning ("Error converting text from IM to UTF-8: %s\n", error->message);
-      g_error_free (error);
+      result = g_convert (str, -1,
+                         "UTF-8", context_xim->mb_charset,
+                         NULL, NULL, &error);
+      if (!result)
+       {
+         g_warning ("Error converting text from IM to UTF-8: %s\n", error->message);
+         g_error_free (error);
+       }
     }
   
   return result;
@@ -603,11 +607,14 @@ xim_text_to_utf8 (GtkIMContextXIM *context, XIMText *xim_text, gchar **text)
          return 0;
        }
 
-      result = g_convert (xim_text->string.multi_byte,
-                         -1,
-                         "UTF-8",
-                         context->mb_charset,
-                         NULL, NULL, &error);
+      if (strcmp (context->mb_charset, "UTF-8") == 0)
+       result = g_strdup (xim_text->string.multi_byte);
+      else
+       result = g_convert (xim_text->string.multi_byte,
+                           -1,
+                           "UTF-8",
+                           context->mb_charset,
+                           NULL, NULL, &error);
       
       if (result)
        {